﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html class="x-admin-sm">
<head>
    <meta name="viewport" content="width=device-width" />
    <meta charset="UTF-8">
    <title>版辊信息详情</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link href="~/Content/X-admin/css/font.css" rel="stylesheet" />
    <link href="~/Content/X-admin/css/xadmin.css" rel="stylesheet" />
    <script src="~/Content/X-admin/js/jquery.min.js"></script>
    <script src="~/Content/X-admin/js/xadmin.js"></script>
    <script src="~/Content/Scripts/System/systemFrame.js"></script>
    <script src="~/Content/Scripts/layui/layui.js"></script>
    <script src="~/Content/Scripts/System/Common.js"></script>
    <link href="~/Content/Scripts/layui/css/layui.css" rel="stylesheet" />
</head>
<body>
    <span style="margin-top:15px;margin-left:15px">
        <xblock>
            <button class="layui-btn" onclick="closeWin()"><i class="layui-icon">&#x1006;</i>取消</button>
        </xblock>
    </span>

    <div style="margin: 20px; border: 1px solid #dbdbdb;padding:15px">

        <form id="AddForm" class="layui-form layui-col-space5">
            <div class="layui-form-item">
                <input type="hidden" name="id" autocomplete="off" class="layui-input" id="userCode">
                <label class="layui-form-label">
                    客户
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="customName" name="customName" autocomplete="off" class="layui-input" >
                    <input type="hidden" id="customCode" name="customCode">
                </div>

                <label class="layui-form-label">
                    存放位置
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="banchang" name="banchang" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <input type="hidden" name="id" autocomplete="off" class="layui-input" id="userCode">
                <label class="layui-form-label">
                    编码
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="pCode" name="pCode" autocomplete="off" class="layui-input">

                </div>

                <label class="layui-form-label">
                    版长
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="banchang" name="banchang" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <input type="hidden" name="id" autocomplete="off" class="layui-input" id="userCode">
                <label class="layui-form-label">
                    键槽
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="jiancao" name="jiancao" autocomplete="off" class="layui-input">
                </div>

                <label class="layui-form-label">
                    共用版
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="gongyongban" name="gongyongban" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label for="L_email" class="layui-form-label">
                    版周
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="banzhou" name="banzhou" autocomplete="off" class="layui-input">

                </div>

                <label for="L_email" class="layui-form-label">
                    版支数
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="banzhi" name="banzhi" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label for="L_email" class="layui-form-label">
                    支数明细
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="banzhi" name="banzhi" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label for="L_email" class="layui-form-label">
                    制版厂家
                </label>
                <div class="layui-input-inline">
                    <select id="zhibanchangjia" name="zhibanchangjia" class="bzbcj">
                        选择厂家
                    </select>
                </div>
                <label for="L_email" class="layui-form-label">
                    版号
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="banhao" name="banhao" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label for="L_email" class="layui-form-label">
                    货号
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="proName" name="proName" autocomplete="off" class="layui-input" >
                    <input type="hidden" id="proCode" name="proCode">
                    <input type="hidden" id="selectProduct" name="selectProduct">

                </div>
                <label for="L_email" class="layui-form-label">
                    规格型号
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="spec" name="spec" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-table-main" id="layui-table-main">
                <table class="layui-hide" id="list" lay-filter="list"></table>
            </div>
        </form>

    </div>
</body>
</html>
<script type="text/javascript">
    
    $(function () {
        var dataId = getUrlVariable("dataId");

        CommonData("zbcj", "bzbcj");
        if (dataId != "0") {
            $("input[ name='id']").val(dataId);
            loadData(dataId);
            
        } 
        //layui.use('form', function () {
        //    var form = layui.form;
        //    form.render();
        //});
    });
    //加载数据信息
    function loadData(dataId) {
        $.ajax({
            url: "../Basis/GetBanGunInfo",
            type: "post",
            data: { dataId: dataId },
            success: function (data) {
                if (data.Result) {

                    $.each(data.Data[0], function (name, value) {
                        $("input[ name='" + name + "']").val(value);
                    });
                    $("#zhibanchangjia  option[value='" + data.Data[0]["zhibanchangjia"] + "'] ").attr("selected", true)
                    layui.use('form', function () {
                        var form = layui.form;
                        form.render();
                    });
                    // 设置下拉选择框的默认选项
                    $('#bStatus').val(data.Data[0]['bStatus']);
                    loadRecords();
                }
            }
        });

    }

    function openWin() {
        InfoOpenPage("../Common/selectCustomer?isSingle=1", "选择客户", "90%", "90%");
    }
 

     /**
     数据加载
     **/
    function loadRecords() {
        layui.use('table', function () {
            var conditon = $("input[ name='pCode']").val();
            var table = layui.table;
            table.render({
                elem: '#list'
            , cols: [[ //标题栏
                    , { field: 'id', title: 'id', width: 90 }
                    , { field: 'doTypeName', title: '操作类型', width: 120 }
                    , { field: 'transportName', title: '运输方式', width: 120 }
                    , { field: 'userName', title: '人员', width: 130 }
                    , { field: 'zhishu', title: '维修支数', width: 100 }
                    , { field: 'money', title: '金额', width: 90 }
                    , { field: 'memo', title: '备注说明', width: 130 }
                    , { field: 'createtime', title: '创建时间', width: 150 }
            ]], done: function (res, curr, count) {
                $("[data-field='id']").css('display', 'none');//隐藏列
             
            }
            , url: '../Basis/GetDataList?condition=' + conditon + "&dataType=bgr" //数据接口
            , skin: 'row' //表格风格
            , even: true
            , page: false //是否显示分页
            , limits: [20, 35, 50]
            , limit: 20 //每页默认显示的数量
            });

        });
    }

</script>